#include <windows.h>

#include "CSpecialMessagePacket.h"
#include "CChar.h"

CSpecialMessagePacket::CSpecialMessagePacket(CChar * schar, unsigned short messageID, unsigned long param1, unsigned long param2, unsigned long param3, unsigned long param4, bool showName) {
	this->type = 0x2A;
	this->size = 0x10;

	memset(data, 0, sizeof(data));

	memcpy(data+0x04-0x04, &schar->m_id, 4);

	memcpy(data+0x08-0x04, &param1, 4);
	memcpy(data+0x0C-0x04, &param2, 4);
	memcpy(data+0x10-0x04, &param3, 4);
	memcpy(data+0x14-0x04, &param4, 4);

	unsigned short targID = 0;
	targID = schar->getTargId();
	memcpy(data+0x18-0x04, &targID, 2);

	messageID += 0x8000;
	memcpy(data+0x1A-0x04, &messageID, 2);

	if(showName) {
		this->size = 0x18;
		memcpy(data+0x1E-0x04, &schar->m_name, 16);
	}
}

CSpecialMessagePacket::~CSpecialMessagePacket() {
}
